<?php
/*
 * Created on 2011-4-23
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 
require ('../Common.inc.php');
require (SERVER_ROOT_PATH . '/config/base.config.php');
require (SERVER_ROOT_PATH . '/lib/Framework.class.php');


new Framework();

$pars=$_POST['pars'];
$pvl=explode("&",$pars);
$identity=explode('=',$pvl['0']);
$title=explode('=',$pvl['2']);
$url=explode('=',$pvl['1']);
$content=urldecode($_POST['b']);


//过滤 ' 引号，以免操作数据库冲突
$replace=array("'"=>'&apos;');
$content=strtr($content,$replace);

$u=new User('w');
//title进行一次unhtml是因为title要当字符串显示，而content要当页面内容的一部分，所以不用
$rs=$u->insertRecord(urldecode($identity[1]),String::unHtml(urldecode($title[1])),$content,urldecode($url[1]));

if($rs){
	echo '添加成功';
}else{
	echo '添加失败';
}
?>
